package com.example.wsh.worddemo.Users_Fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.wsh.worddemo.R;
import com.example.wsh.worddemo.Users_Fragment.Setting;
import com.getbase.floatingactionbutton.FloatingActionButton;

public class UsersFragment extends Fragment {

    private FloatingActionButton Set;
    private FloatingActionButton Help;
    private FloatingActionButton About;

    //    声明事件监听
    private View.OnClickListener onClickListener;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.users_fragment,container,false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        initViews();
        initEvent();
    }

    private void initViews(){
        Set   = getActivity().findViewById(R.id.Set);
        Help   = getActivity().findViewById(R.id.Help);
        About   = getActivity().findViewById(R.id.About);
    }

    private void initEvent() {
        Set.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Setting.class);
                startActivity(intent);
            }
        });

        Help.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Help.class);
                startActivity(intent);
            }
        });

        About.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),About.class);
                startActivity(intent);
            }
        });
    }
}
